"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _jsxRuntime = require("react/jsx-runtime");

var _antdV = require("antd-v4");

var _classnames = _interopRequireDefault(require("classnames"));

var _react = require("react");

require("./index.less");

var _default = function _default(_ref) {
  var className = _ref.className,
      prefixCls = _ref.prefixCls,
      links = _ref.links,
      copyright = _ref.copyright,
      style = _ref.style;
  var context = (0, _react.useContext)(_antdV.ConfigProvider.ConfigContext);
  var baseClassName = context.getPrefixCls(prefixCls || 'pro-global-footer');

  if ((links == null || links === false || Array.isArray(links) && links.length === 0) && (copyright == null || copyright === false)) {
    return null;
  }

  var clsString = (0, _classnames.default)(baseClassName, className);
  return (0, _jsxRuntime.jsxs)("div", {
    className: clsString,
    style: style,
    children: [links && (0, _jsxRuntime.jsx)("div", {
      className: "".concat(baseClassName, "-links"),
      children: links.map(function (link) {
        return (0, _jsxRuntime.jsx)("a", {
          title: link.key,
          target: link.blankTarget ? '_blank' : '_self',
          href: link.href,
          rel: "noreferrer",
          children: link.title
        }, link.key);
      })
    }), copyright && (0, _jsxRuntime.jsx)("div", {
      className: "".concat(baseClassName, "-copyright"),
      children: copyright
    })]
  });
};

exports.default = _default;